home *** CD-ROM | disk | FTP | other *** search
/ Clickx 96 / Clickx 96.iso / software / tools / tool / xbmc-10.1.exe / system / shaders / yuv2rgb_basic_rect_YUY2.arb < prev    next >
Encoding:
ARB Fragment shader  |  2011-03-08  |  1.7 KB  |  66 lines

  1. !!ARBfp1.0
  2.  
  3. #
  4. #      Copyright (C) 2010 Team XBMC
  5. #      http://www.xbmc.org
  6. #
  7. #  This Program is free software; you can redistribute it and/or modify
  8. #  it under the terms of the GNU General Public License as published by
  9. #  the Free Software Foundation; either version 2, or (at your option)
  10. #  any later version.
  11. #
  12. #  This Program is distributed in the hope that it will be useful,
  13. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. #  GNU General Public License for more details.
  16. #
  17. #  You should have received a copy of the GNU General Public License
  18. #  along with XBMC; see the file COPYING.  If not, write to
  19. #  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20. #  http://www.gnu.org/copyleft/gpl.html
  21. #
  22. #
  23.  
  24. PARAM yuvmat[4] = { program.local[0..3] };
  25. TEMP  f;
  26. TEMP  pos;
  27. ADD   pos.x  , fragment.texcoord[0].x, -0.25;
  28. MOV   pos.y  , fragment.texcoord[0].y;
  29. FRC   f      , pos;
  30.  
  31. TEMP  c1pos;
  32. TEMP  c2pos;
  33. SUB   c1pos.x, 0.5, f.x;
  34. SUB   c2pos.x, 1.5, f.x;
  35. ADD   c1pos.x, c1pos.x, pos.x;
  36. ADD   c2pos.x, c2pos.x, pos.x;
  37. MOV   c1pos.y, pos.y;
  38. MOV   c2pos.y, pos.y;
  39.  
  40. TEMP  c1;
  41. TEMP  c2;
  42. TEX   c1, c1pos, texture[0], RECT;
  43. TEX   c2, c2pos, texture[0], RECT;
  44.  
  45. TEMP  cint;
  46. MUL   cint.x, f.x, 2.0;
  47. MAD   cint.y, f.x, 2.0, -1.0;
  48. SGE   cint.z, f.x, 0.5;
  49.  
  50. TEMP  yuv;
  51. LRP   yuv.g, cint.x, c1.r , c1.b;
  52. LRP   yuv.b, cint.y, c2.b , c1.r;
  53. LRP   yuv.r, cint.z, yuv.b, yuv.g;
  54.  
  55. LRP   yuv.g, f.x   , c2.g , c1.g;
  56. LRP   yuv.b, f.x   , c2.a , c1.a;
  57.  
  58. TEMP  rgb;
  59. DPH   rgb.r, yuv, yuvmat[0];
  60. DPH   rgb.g, yuv, yuvmat[1];
  61. DPH   rgb.b, yuv, yuvmat[2];
  62. MOV   rgb.a, fragment.color.a;
  63. MOV   result.color, rgb;
  64.  
  65. END
  66.